<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="renderer" content="webkit">
		<title> 会员管理</title>
		<meta name="keywords" content="">
		<meta name="description" content="">
		<!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
		<link rel="shortcut icon" href="favicon.ico">
		<link href="__STATIC__/css/bootstrap.min.css" rel="stylesheet">
		<link href="__STATIC__/css/font-awesome.min.css" rel="stylesheet">
		<link href="__STATIC__/css/plugins/iCheck/custom.css" rel="stylesheet">

		<link href="__STATIC__/css/animate.css" rel="stylesheet">
		<link href="__STATIC__/css/style.css" rel="stylesheet">
	</head>

	<body class="fixed-sidebar full-height-layout gray-bg">
		<div id="wrapper">
			<!--左侧导航开始-->
			<include file="Public/left" title="left" />
			<!--左侧导航结束-->
			<!--右侧部分开始-->
			<div id="page-wrapper" class="gray-bg dashbard-1" style="height: auto;">
				<include file="Public/top" title="top" />
				<div class="row J_mainContent" id="content-main">
					<div class="col-sm-12">
						<div class="ibox float-e-margins">
							<div class="ibox-content">
								<div class="row">
									<div class="col-md-8">
										<a class="btn btn-success" href="{:U('member/add')}">
											<i class="fa fa-user-plus"></i> 添加用户
										</a>
										<a class="btn btn-info" href="{:U('member/index')}">
											所有用户</a>
									</div>
									<div class="col-sm-4">
										<form action="{:U('member/index')}" method="post">
											<div class="form-group input-group">
												<input type="text" class="form-control" name="key" placeholder="输入用户名关键词搜索">
												<span class="input-group-btn"><input class="btn btn-default" type="submit" value="搜索"></span>
											</div>
										</form>
									</div>
								</div>
								<div class="table-responsive">
									<table class="table table-striped">
										<thead>
											<tr>
												<!--<th></th>-->
												<th>ID</th>
												<th>邮箱</th>
												<th>手机号</th>
												<th>会员状态</th>
												<th>注册时间</th>
												<th>到期时间</th>
												<th>登录IP</th>
												<th>状态</th>
											
												<th>应用个数</th>
												<th>余额</th>
												<th>下载次数</th>
												<th style="text-align: center;">操作</th>
											</tr>
										</thead>
										<tbody>
											<foreach name="member" item="v" key="k">
												
													<tr>
														<td><input type="checkbox" class="i-checks" value="{$v.id}">{$v.id}</td>
														<!--id数字-->
														<td>{$v.username}</td>
														<td>{$v.phone}</td>
														<td>
															<if condition="$v.isvip eq 0">
																<font color="#FF0000" style="font-weight: bolder;">&nbsp;vip用户</font>
																<else/>
																<font>普通用户</font>
															</if>
														</td>

														<td>{$v.create_time|date="Y/m/d",###}</td>
														<!--注册时间-->
														<td>{$v.tianshu|date="Y/m/d",###}</td>
														<!--到期时间-->
														<td>{$v.login_ip}</td>
														<!--登录IP-->
<!-- 														<td>
															<if condition="$v.type eq 1"> <span class="label label-success">会员</span>
																<elseif condition="$v.type eq 2" /><span class="label label-danger">管理员</span>
															</if>
														</td> -->
														<!--类型-->
														<td>
															<if condition="$v.status eq 1">正常
																<else/><span style="color:red">禁用</span></if>
														</td>
														<td>
														<!--应用个数-->
														{$v.appnum}个</td>
														<td>{$v.mymoney}元</td>
														<td>{$v.downnum}</td>
														<!--状态-->
														<if condition="$v.status eq 1">
															<td style="text-align: center;">
																<a href="{:U('member/update',array('id'=>$v['id']))}">编辑</a> |
																<a href="{:U('member/delete',array('id'=>$v['id']))}" style="color:red;" onclick="javascript:return del('禁用后用户将不能登陆后台!\n\n请确认!!!');">禁用</a> |
																<a href="{:U('member/alldel',array('id'=>$v['id']))}" style="color:red;" onclick="javascript:return del('删除后用户将不能登陆后台!\n\n请确认!!!');">删除</a>
                                                                <a href="{:U('list/index',array('fid'=>$v['id']))}">查看应用</a>
															</td>
															<else/>
															<td style="text-align: center;">
																<a href="{:U('member/update',array('id'=>$v['id']))}">编辑</a> |
																<a href="{:U('member/delete',array('id'=>$v['id']))}" style="color:#50AD1E;">启用</a> |
																<a href="{:U('member/alldel',array('id'=>$v['id']))}" style="color:red;" onclick="javascript:return del('删除后用户将不能登陆后台!\n\n请确认!!!');">删除</a>
																<a href="{:U('list/index',array('fid'=>$v['id']))}">查看应用</a>
															</td>
														</if>
													</tr>
												
											</foreach>
										</tbody>
									</table>
									<span>

									</span>
									<!-- <div class="clearfix"></div> -->
									{$page}
								</div>

							</div>
						</div>
					</div>
				</div>
			</div>
			<!--右侧部分结束-->
		</div>

		<!-- 全局js -->
		<script src="__STATIC__/js/jquery.min.js"></script>
		<script src="__STATIC__/js/bootstrap.min.js"></script>
		<script src="__STATIC__/js/plugins/metisMenu/jquery.metisMenu.js"></script>
		<script src="__STATIC__/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
		<script src="__STATIC__/js/plugins/layer/layer.min.js"></script>

		<!-- 自定义js -->
		<script src="__STATIC__/js/hAdmin.js"></script>

		<!-- 第三方插件 -->
		<script src="__STATIC__/js/plugins/pace/pace.min.js"></script>
		<script src="__STATIC__/js/content.js"></script>
		<!-- iCheck -->
		<script src="__STATIC__/js/plugins/iCheck/icheck.min.js"></script>
		</script>
	</body>

</html>
<script>
	$(document).ready(function() {
		$('.i-checks').iCheck({
			checkboxClass: 'icheckbox_square-green',
			radioClass: 'iradio_square-green',
		});
		var checkAll = $('#quanxuan'); //全选的input
		var checkboxs = $('.i-checks'); //所有单选的input

		checkAll.on('ifChecked ifUnchecked', function(event) {
			if(event.type == 'ifChecked') {
				checkboxs.iCheck('check');
			} else {
				checkboxs.iCheck('uncheck');
			}
		});
		checkboxs.on('ifChanged', function(event) {
			if(checkboxs.filter(':checked').length == checkboxs.length - 1) {
				checkAll.prop('checked', true);
			} else {
				checkAll.prop('checked', false);
			}
			checkAll.iCheck('update');
		})

	});
</script>